import redis

conn = redis.Redis(host='192.168.2.236', port=6379, password='foobared', encoding='utf-8')
conn.set('username', 'qiaofinn', ex=30)
value = conn.get('username')

print(value)
